package com.cykj.finance.service.impl;

import java.util.List;

import com.cykj.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cykj.finance.mapper.FnLevelCommissionMapper;
import com.cykj.finance.domain.FnLevelCommission;
import com.cykj.finance.service.IFnLevelCommissionService;

/**
 * 等级佣金Service业务层处理
 * @author 天才少年
 * @date 2025-08-19
 */
@Service
public class FnLevelCommissionServiceImpl implements IFnLevelCommissionService {
    @Autowired
    private FnLevelCommissionMapper fnLevelCommissionMapper;

    /**
     * 查询等级佣金
     *
     * @param levelId 等级佣金主键
     * @return 等级佣金
     */
    @Override
    public FnLevelCommission selectFnLevelCommissionByLevelId(Long levelId) {
        return fnLevelCommissionMapper.selectFnLevelCommissionByLevelId(levelId);
    }

    /**
     * 查询等级佣金列表
     *
     * @param fnLevelCommission 等级佣金
     * @return 等级佣金
     */
    @Override
    public List<FnLevelCommission> selectFnLevelCommissionList(FnLevelCommission fnLevelCommission) {
        return fnLevelCommissionMapper.selectFnLevelCommissionList(fnLevelCommission);
    }

    /**
     * 新增等级佣金
     *
     * @param fnLevelCommission 等级佣金
     * @return 结果
     */
    @Override
    public int insertFnLevelCommission(FnLevelCommission fnLevelCommission) {
        fnLevelCommission.setCreateTime(DateUtils.getNowDate());
        return fnLevelCommissionMapper.insertFnLevelCommission(fnLevelCommission);
    }

    /**
     * 修改等级佣金
     *
     * @param fnLevelCommission 等级佣金
     * @return 结果
     */
    @Override
    public int updateFnLevelCommission(FnLevelCommission fnLevelCommission) {
        return fnLevelCommissionMapper.updateFnLevelCommission(fnLevelCommission);
    }

    /**
     * 批量删除等级佣金
     *
     * @param levelIds 需要删除的等级佣金主键
     * @return 结果
     */
    @Override
    public int deleteFnLevelCommissionByLevelIds(Long[] levelIds) {
        return fnLevelCommissionMapper.deleteFnLevelCommissionByLevelIds(levelIds);
    }

    /**
     * 删除等级佣金信息
     *
     * @param levelId 等级佣金主键
     * @return 结果
     */
    @Override
    public int deleteFnLevelCommissionByLevelId(Long levelId) {
        return fnLevelCommissionMapper.deleteFnLevelCommissionByLevelId(levelId);
    }
}
